package com.zx.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * <h1>订单信息</h1>
 * */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderInfo {
    private Long userAddress;
    private List<OrderItem> orderItems;
    /**
     * <h2>订单中的商品信息</h2>
     * */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class OrderItem {
        private Long goodsId;
        private Long count;
        public DeductGoodsInventory toDeductGoodsInventory() {
            return new DeductGoodsInventory(this.goodsId, this.count);
        }
    }
}
